Ajax = {}

/**
 * @classDescription Ajax底层httpRequest对象封装
 * @author Tousin
 * @constructor
 */
Ajax.HttpRequest = function(){
	var request = false //variable to hold ajax object
   	if (window.XMLHttpRequest) { // if Mozilla, Safari etc
		request = new XMLHttpRequest();
	}
	else 
		if (window.ActiveXObject) { // if IE
			var arrVersions = ["Microsoft.XMLHTTP", "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp", "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP"];
			for (var i = 0; i < arrVersions.length; i++) {
				try {
					request = new ActiveXObject(arrVersions[i]);
					break;
				} 
				catch (exception) {
					if (i == arrVersions.length - 1) {
						throw new Error("doesn't find a current paramter to your IE browser , XMLHttpRequest exception");
					}
				}
			}
		}
		else {
			throw new Error("your browser doesn't support a XMLHttpRequest Object");
		}
	return request;
}
